package com.sauro.util;


import lombok.extern.slf4j.Slf4j;

@Slf4j
@SuppressWarnings("serial")
public class IllegalParameterException extends BaseException {


    private AbstractCodeUtil msgCode;

    public IllegalParameterException() {
    }

    public IllegalParameterException(String msg) {
        super(msg);
    }

    public IllegalParameterException(Throwable ex) {
        super(ex);
    }

    public IllegalParameterException(Throwable ex, AbstractCodeUtil codeUtil, Object... args) {
        super(ex, codeUtil, args);
    }

    public IllegalParameterException(AbstractCodeUtil codeUtil, Object... args) {
        super(codeUtil, args);
        log.info("module=IllegalParameterException;event=" + codeUtil);
        this.msgCode = codeUtil;
    }

    public AbstractCodeUtil getErrorCode() {
        return msgCode;
    }

    /**
     * <B>方法名称：</B><BR>
     * <B>概要说明：</B><BR>
     *
     */
    @Override
    protected AbstractCodeUtil getMsgCode() {
        return msgCode == null ? BaseCodeUtil.PARAMETER_ERROR : msgCode;
    }
}
